import request from '@/utils/request'
import qs from 'qs'
const Host = process.env.VUE_APP_BASE_URL
const levelToUrl = {
  1: '/StuBasicInfoBLL/queryAllTime',
  2: '/StuBasicInfoBLL/queryAllTerm',
  3: '/StuBasicInfoBLL/queryAllCollege',
  4: '/StuBasicInfoBLL/queryAllGrade',
  5: '/StuBasicInfoBLL/queryAllMajor',
  6: '/StuBasicInfoBLL/queryAllClass'
}
export function option(level, data) {
  return request({
    url: Host + levelToUrl[level],
    method: 'post',
    data: data
  })
}

export function list(params) {
  return request({
    url: Host + '/StuBasicInfoBLL/queryByOption',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: params
  })
}

export function detail(params) {
  return request({
    url: Host + '/SorceBLL/selectByTaskIDID',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: params
  })
}

export function option2() {
  return request({
    url: 'https://mobile-ms.uat.homecreditcfc.cn/mock/615a706b646d610027844050/tice/measure/download/option', // Host + '/TaskBLL/add',
    method: 'get'
  })
}

export function list2(params) {
  return request({
    url: Host + '/StuBasicInfoBLL/selectTimeCollege',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify({ data: JSON.stringify(params) })
  })
}

export function teacher() {
  return request({
    url: 'https://mobile-ms.uat.homecreditcfc.cn/mock/615a706b646d610027844050/tice/task/list', // Host + '/TaskBLL/selectCurrent',
    method: 'get'
  })
}
